body {
  font-family: $font-family-default;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  @media (max-width: $screen-xs-max) {
    width: 100%;
    min-width: 100%;
    background: #fff;
    padding-top: 50px;
  }

  .docs {
    background: linear-gradient(90deg, $whiteish, $whiteish ($sidenav-width),
      white ($sidenav-width), white 100%);
  }
}

#components-index ul.nav > li > a {
  background-color: #F9FAFB;
}

.improve-docs {
  position: absolute;
  right: 3.5em;
  top: 20px;
}

.improve-v2-docs {
  display: block;
  float: right;
  margin-top: -7em;
}

.component-doc-demo {
  display: block;
  float: right;
  margin-top: -3.1em;
}

.docs-container {
  .side-nav {
    width: $sidenav-width;
    // padding-top: 73px;
  }

  > main {
    margin-left: $sidenav-width;
  }

  > aside {
    width: $platform-preview-width;

    + main {
      margin-right: $platform-preview-width - 60px;
      min-height: 777px;
    }
  }

  @media (max-width: 1100px) {
    aside {
      display: none;

      & + main {
        margin-right: 0;
      }
    }
  }

  @media (max-width: $screen-xs-max) {
    background-color: #fff;

    main {
      margin-left: 0;
      padding: 30px 20px;
    }

    #side-nav {
      padding-top: 0;
      top: 50px;
      z-index: 1;
      transform: translateX(-$sidenav-width);
      transition: transform .3s ease;

      &.shown {
        transform: translateX(0);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
        transition: transform .3s ease;
      }
    }
  }
}

.side-nav {
  position: fixed;
  background: $whiteish;
  overflow-y: scroll;
  top: 0;
  bottom: 0;
  z-index: 1;
  overflow-y: -moz-scrollbars-none;
  -ms-overflow-style: -ms-autohiding-scrollbar;
  -webkit-overflow-scrolling: touch;
  -webkit-touch-callout: none;
  user-select: none;
  overflow-y: scroll;

  &::-webkit-scrollbar {
    display: none;
    width: 0 !important;
  }

  .back-to-main {
    a {
      padding-top: 5px;
      border: 1px solid #e6e9ee;
      padding: 10px 12px 13px;
      margin-right: 20px;
      margin-top: -15px;
      border-radius: 4px;
      margin-bottom: 10px;
      text-align: center;
      transition: .2s border-color, .2s color, .2s background, .2s box-shadow;

      &::before {
        font-family: 'Ionicons';
        -webkit-font-smoothing: antialiased;
        content: '\f3cf';
        font-size: 16px;
        font-weight: 800;
        position: relative;
        padding-right: 5px;
        top: 2px;
      }

      &:hover {
        border-color: #DFE3E8;
        color: $blue;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
        background: #fdfdfd;
      }

      &:focus::after {
        border-right-color: transparent;
      }
    }
  }

  .form-group {
    position: relative;
    border-bottom: 1px solid $light-grey;
    min-height: 54px;

    &.search {
      padding: 22px 20px 20px;
      margin-bottom: 0;

      &:hover::before {
        color: #a4abb5;
      }

      &::before {
        font-family: 'Ionicons';
        content: '\f4a5';
        font-size: 20px;
        font-weight: 800;
        color: #a4abb5;
        position: absolute;
        top: 25px;
        left: 34px;
        transition: .2s color;
      }

      input {
        border: 1px solid $light-grey;
        border-radius: 20px;
        padding: 15px 0 13px 35px;
        font-size: 14px;
        box-shadow: none;
        transition: .2s border-color, .2s box-shadow;

        &:focus,
        &:hover {
          box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
          border-color: $blue;
        }
      }
    }

    select {
      padding: 17px 20px;
      display: block;
      width: 100%;
      background: none;
      border-radius: 0;
      border: 0;
      outline: none;
      color: $grey;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      transition: .2s border-color, .2s color, .2s background, .2s box-shadow;

      &:hover {
        border-color: $blue;
        color: $blue;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        background: #fdfdfd;
      }
    }

    &:hover {
      transition: .2s border-color;

      &::before {
        color: $blue;
      }
    }

    &.api-select::before {
      font-family: 'Ionicons';
      -webkit-font-smoothing: antialiased;
      content: '\f3d0';
      font-size: 14px;
      font-weight: 800;
      color: #a4abb5;
      position: absolute;
      top: 17px;
      right: 20px;
      transition: .2s color;
    }
  }

  ul {
    list-style: none;
    padding: 18px 0 20px 20px;

    a {
      color: $grey;
      text-transform: uppercase;
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 2px;
      text-decoration: none;
      display: block;
      padding: 10px 0;
      position: relative;
      cursor: pointer;

      &::after {
        display: block;
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        content: '';
        border-right: 2px solid $blue;
        transform: scaleY(0.0001);
        transition: transform .08s ease-in-out;
      }
    }

    ul,
    .capitalize {
      padding: 0;
      opacity: 1;

      a {
        color: $blackish;
        text-transform: none;
        font-size: 13px;
        font-weight: 400;
        letter-spacing: 0;
        height: 34px;
        transition: height cubic-bezier(0.36, 0.66, 0.04, 1) 0.4s,
                    padding cubic-bezier(0.36, 0.66, 0.04, 1) 0.4s,
                    color 0.2s;

        &:empty {
          display: none;
        }
      }

      &.ng-hide-add,
      &.ng-hide-remove {
        transition: opacity cubic-bezier(0.36, 0.66, 0.04, 1) 0.4s;
      }

      &.ng-hide {
        opacity: 0;

        a {
          padding: 0;
          height: 0;
        }
      }
    }

    ul .active > a,
    .capitalize.active > a,
    a:hover,
    .active.top-level > a {
      color: $blue;
      text-decoration: none;
      background: none;
    }

    ul .active > a::after,
    .capitalize.active > a::after,
    a:focus::after,
    .active.top-level > a::after {
      transform: scaleY(1);
      outline: none;
    }


  }
}

// sticky footer
html {
  position: relative;
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0 0 -130px; // bottom = footer height
}

a {
  color: $blue;
  transition: .3s color;
}

.footer-links {
  position: absolute;
  left: $sidenav-width + 40px;
  bottom: 0;
  height: 130px;
  right: 40px;
  @media (max-width: $screen-xs-max) {
    left: 40px;
  }
}

a.footer-link {
  color: black;
  font-size: 18px;
  text-decoration: none;
  font-weight: 500;
  position: absolute;
  padding-top: 10px;
  right: 40px;
  text-align: right;
  transition: color .2s;

  &.prev {
    right: auto;
    left: 40px;
    text-align: left;

    @media (max-width: 500px) {
      display: none;
    }

    &::before {
      content: 'Previous';
    }

    &::after {
      right: auto;
      left: -25px;
      content: '\f117';
    }
  }

  &:hover {
    color: $blue;
  }

  &::before {
    display: block;
    content: 'Next';
    font-size: 13px;
    color: $grey;
    font-weight: 400;
  }

  &::after {
    content: '\f119';
    font-family: Ionicons;
    display: block;
    position: absolute;
    right: -25px;
    font-size: 32px;
    font-weight: 600;
    bottom: -10px;
  }
}

.docs-container {
  min-height: 100%;

  main {
    padding: 50px 40px 100px;

    h1,
    h2,
    h3,
    h4,
    h5 {
      color: $blacker;
      line-height: 1.4em;
      margin: 2em 0 1em;
      font-size: 26px;
      font-weight: 400;
      letter-spacing: -0.01em;
      // position: relative;

      &:first-child {
        margin-top: 0;
      }

      a.anchor {
        &::before {
          content: '\f22a';
          font-family: 'Ionicons';
          margin-left: -15px;
          margin-right: 5px;
          font-size: 14px;
          color: $light-grey;
          transition: .3s color;
        }

        &:hover::before,
        &:active::before {
          color: rgba($blue, .6);
        }
      }
    }

    h1 {
      margin-bottom: 0;

      a.anchor::before {
        margin-left: -23px;
      }
    }

    h2 {
      padding: 2em 0 0;
      font-size: 24px;

      &.section-header {
        border-top: 1px solid #F0F3F7;
        margin-top: 5.6em;
      }
    }

    h3 {
      margin: 3.2em 0 0;
      font-size: 18px;

      &.no-para {
        margin-bottom: 1em;
      }
    }

    h4 {
      font-size: 16px;
    }

    h5 {
      font-size: 14px;
    }

    h6 {
      font-size: 12px;
    }

    p {
      color: $blackish;
      line-height: 1.9em;
      margin: 1.2em 0 1.6em;
      font-weight: 400;
      font-size: 14px;
    }

    pre {
      border: 1px solid $light-grey;
      background: white;
      padding: 16px;
      line-height: 24px;
    }

    a:not(.btn) {
      color: $blue;
      text-decoration: none;
      transition: .2s color;

      &:hover {
        color: lighten($blue, 15);
      }
    }

    table {
      width: 100%;
    }

    td,
    th {
      white-space: nowrap;

      &:last-child {
        white-space: normal;
        width: 99%;
      }
    }

    b,
    strong {
      font-weight: 500;
      color: #26292e;
    }

    .fixed-width {
      font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    }

    .nav {
      a {
        padding-top: 5px;
        padding-bottom: 5px;
      }
    }

    blockquote {
      padding: 0 15px;
      margin: 40px 0;
      font-size: 16px;
      border-left: 4px solid #eeeeee;
    }

    img.section-header {
      width: 100%;
      margin: 50px 0;
      max-width: 1037px;
      display: block;
    }
  }
}

.platform-preview {
  position: absolute;
  right: 0;
  text-align: center;
  right: -20px;

  &.fixey {
    position: fixed;
    top: 0;
  }
}

.platform-preview .platform-toggle, .docs-container .sass-platform-toggle {

  a {
    cursor: pointer;
    display: inline-block;
    padding: 4px 16px;
    border-radius: 16px;
    color: $grey;
    font-size: 14px;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    transition: .2s color, .2s background-color;

    &.active,
    &.active:hover {
      background-color: $blue;
      color: white;
    }

    &:hover {
      color: $blue;
      text-decoration: none;
    }
  }
}

.platform-preview  .platform-toggle {
  padding: 8px 10px 4px;
}

.docs-container .sass-platform-toggle {
  padding-top: 0px 10px 4px;
  margin-bottom: 10px;
  float: right;
}

#sass-variable-header {
  margin-bottom: 0px;
  padding-bottom: 0px;
}

#sass-variables {
  margin-bottom: 0px;
  position: relative;
  bottom: 15px;

  .table.param-table {
    td,
    th {
      white-space: nowrap;

      &:last-child, &:nth-last-child(2) {
        white-space: normal;
      }

      &:nth-last-child(2) {
        width: 10%;
      }
    }
  }
}

@media (max-width: 1300px) and (min-width: $screen-xs) {
  #sass-variables {
    bottom: -10px;
  }
}

@media (max-width: $screen-xs) {
  #sass-variables {
    bottom: -25px;

    .table.param-table {
      tr,td {
        white-space: normal;
      }
    }
  }
}

#demo-device-ios {
  width: $platform-preview-width;
  height: 800px;
  background: center top no-repeat url('/img/devices-sprite.jpg');
  background-size: $platform-preview-width;
  margin: 0 auto;

  iframe {
    margin-top: 85px;
    width: 320px;
    height: 568px;
  }
}

#demo-device-android {
  @extend #demo-device-ios;

  background-position: center center;

  iframe {
    margin-top: 64px;
    width: 360px;
    height: 590px;
  }
}

#demo-device-windows {
  @extend #demo-device-ios;

  background-position: center bottom;

  iframe {
    margin-top: 72px;
    width: 350px;
    height: 622px;
    background: white;
  }
}

li.nav-item-hidden {
  position: absolute;
  top: -9999px;
  left: -9999px;
}

ul.docs-content {
  list-style: none;
  line-height: 26px;
  padding-left: 16px;

  li.docs-content-header {
    font-weight: 400;
    color: #B9BEC5;
  }

}

ul.docs-example {
  list-style: none;
  display: block;
  margin: 3em 0;
  padding: 0;
  border-radius: 4px;

  li {
    display: inline-block;
    border: 1px solid #e6e9ee;
    width: 32%;
    margin: 0;
    padding: 8% 0;

    @media screen and (max-width: $screen-xs-max) {
      display: block;
      width: 100%;
      margin-bottom: 1em;
    }

    &:not(:first-child) {
      margin-left: 1%;
    }
  }

  li img {
    display: block;
    margin: 0 auto;
    width: 55.7%;
  }
}

.highlight .err {
  background-color: #fff;
}

.param-table {
  td p {
    margin: 0;
    line-height: 22px;

    .tag {
      background: $blue;
      margin-left: 10px;
      padding: 5px 7px 4px;
      border-radius: 4px;
      color: white;
      font-weight: 700;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .5px;
    }
  }

  td ul {
    list-style: none;
    margin-right: -7px;
    margin-left: -92px;
    border: 1px solid #e6e9ee;
    border-left: 0;
    border-top: 0;
    padding: 10px 17px;
    border-bottom-right-radius: 0.5em;

    li {
      padding: 0;
      margin: 17px 0;
    }
  }
}

.return-value {
  b {
    &::before {
      font-family: 'Ionicons';
      -webkit-font-smoothing: antialiased;
      content: '\f203';
      font-size: 16px;
      font-weight: 800;
      position: relative;
      padding-right: 5px;
      top: 2px;
    }
  }
}

.docs-container h3 a:not([role='button']) {
  color: #26292e !important;

  &:hover {
    color: #26292e !important;
  }
}


.faq-section {
  margin: 80px auto;
}

@media (max-width: $screen-sm-max) and (min-width: $screen-sm-min){
  .hide-sm {
    display: none !important;
  }
}

.native-docs a{
  margin-top: 0 !important;
}
